import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp

/**
 * @author ldh
 * 时间: 2022/10/13 17:47
 * 邮箱: 2637614077@qq.com
 */

@Composable
fun EducationScreen(page: Int) {
    LazyColumn(modifier = Modifier.fillMaxSize(), horizontalAlignment = Alignment.CenterHorizontally) {
        when (page) {
            1 -> EducationPart1()
            2 -> EducationPart2()
            3 -> EducationPart3()
            4 -> EducationPart4()
        }
    }
}

fun LazyListScope.EducationPart1() {
    item {
        Text(
            text = "主程序-子程序软件体系结构",
            fontWeight = FontWeight.Bold,
            fontSize = 30.sp,
            modifier = Modifier.padding(top = 20.dp, bottom = 40.dp)
        )
    }
    item {
        Image("img/part1/pic1_1.png")
    }
    item {
        Image("img/part1/pic1_2.png")
    }
    item {
        Image("img/part1/pic1_3.png")
    }
}

fun LazyListScope.EducationPart2() {
    item {
        Text(
            text = "面向对象软件体系结构",
            fontWeight = FontWeight.Bold,
            fontSize = 30.sp,
            modifier = Modifier.padding(top = 20.dp, bottom = 40.dp)
        )
    }
    item {
        Image("img/part2/img2_1.png")
    }
    item {
        Image("img/part2/img2_2.png")
    }
}


fun LazyListScope.EducationPart3() {
    item {
        Text(
            text = "事件系统软件体系结构",
            fontWeight = FontWeight.Bold,
            fontSize = 30.sp,
            modifier = Modifier.padding(top = 20.dp, bottom = 40.dp)
        )
    }
    item {
        Image("img/part3/img3_1.png")
    }
    item {
        Image("img/part3/img3_2.png")
    }
}


fun LazyListScope.EducationPart4() {
    item {
        Text(
            text = "管道-过滤软件体系结构",
            fontWeight = FontWeight.Bold,
            fontSize = 30.sp,
            modifier = Modifier.padding(top = 20.dp, bottom = 40.dp)
        )
    }
    item {
        Image("img/part4/img4_1.png")
    }
    item {
        Image("img/part4/img4_2.png")
    }
}

